﻿using PHMEE.ToolKits;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PHMEE
{
    /// <summary>
    /// 离心式泵
    /// </summary>
    public class CentrifugalPump : Equipment
    {

        protected CentrifugalPump()
        {

        }

        public CentrifugalPump(Guid id, Guid unitId, string name, string nameen, int number)
            : base(id, unitId, name, nameen, number)
        {

        }


        /// <summary>
        /// 流量
        /// </summary>
        [NotMapped]
        public double Capacity { get; set; }

        /// <summary>
        /// 扬程
        /// </summary>
        [NotMapped]
        public double Head { get; set; }

        /// <summary>
        /// 转速
        /// </summary>
        [NotMapped]
        public double Speed { get; set; }

        /// <summary>
        /// 气蚀余量
        /// </summary>
        [NotMapped]
        public double NPSHr { get; set; }

        /// <summary>
        /// 配用功率
        /// </summary>
        [NotMapped]
        public double MatchedPower { get; set; }

        /// <summary>
        /// 叶轮数
        /// </summary>
        [NotMapped]
        public double VaneNumber { get; set; }

        /// <summary>
        /// 支撑方式
        /// </summary>
        [NotMapped]
        public SupportFlexibilityMode SupportFlexibilityMode { get; set; }

        /// <summary>
        /// 转动方式
        /// </summary>
        [NotMapped]
        public RotationMode RotationMode { get; set; }

        /// <summary>
        /// 基座类型
        /// </summary>
        [NotMapped]
        public ConnectMode ConnectMode { get; set; }

        /// <summary>
        /// 轴承类型
        /// </summary>
        [NotMapped]
        public BearingType BearingType { get; set; }

        /// <summary>
        /// 泵驱动端轴承型号1
        /// </summary>
        [NotMapped]
        public string PumpEndBearModelFirst { get; set; }

        /// <summary>
        /// 泵驱动端轴承厂商1
        /// </summary>
        [NotMapped]
        public int PumpEndBearFactoryFirst { get; set; }

        /// <summary>
        /// 泵驱动端轴承型号2
        /// </summary>
        [NotMapped]
        public string PumpEndBearModelSecond { get; set; }

        /// <summary>
        /// 泵驱动端轴承厂商2
        /// </summary>
        [NotMapped]
        public int PumpEndBearFactorySecond { get; set; }

        /// <summary>
        /// 泵自由端轴承型号
        /// </summary>
        [NotMapped]
        public string NonPumpEndBearModel { get; set; }

        /// <summary>
        /// 泵自由端轴承厂商
        /// </summary>
        [NotMapped]
        public int NonPumpEndBearFactory { get; set; }

        public override void SerializeProperties(Dictionary<string, object> derivedPropertiesJson)
        {
            var properties = PHMEECoreHelper.GetDerivedProperties(this);
            this.DerivedPropertiesJson = derivedPropertiesJson.Where(item => properties.Keys.Any(p => string.Equals(p, item.Key, StringComparison.OrdinalIgnoreCase))).ToDictionary();
        }

        public override void DeserializeProperties()
        {
            PHMEECoreHelper.SetDerivedProperties(this, DerivedPropertiesJson);
        }

    }
}
